{% load staticfiles %}
<div class="topbar">

    <!-- LOGO -->
    <div class="topbar-left">
        <a href="{% url 'ucenter' %}" class="logo"><span>Wan<span>Feng</span></span><i class="glyphicon glyphicon-home"></i></a>
        <!-- Image logo -->
        <!--<a href="index.html" class="logo">-->
        <!--<span>-->
        <!--<img src="assets/images/logo.png" alt="" height="30">-->
        <!--</span>-->
        <!--<i>-->
        <!--<img src="assets/images/logo_sm.png" alt="" height="28">-->
        <!--</i>-->
        <!--</a>-->
    </div>

    <!-- Button mobile view to collapse sidebar menu -->
    <div class="navbar navbar-default" role="navigation">
        <div class="container">

            <!-- Navbar-left -->
            <ul class="nav navbar-nav navbar-left">
                <li>
                    <button class="button-menu-mobile open-left waves-effect">
                        <i class="mdi mdi-menu"></i>
                    </button>
                </li>
                <li class="hidden-xs hidden-sm">
                    <form role="search" class="app-search" action="{% url 'search' %}" method="GET">
                        <input type="text" placeholder="Search..." name="key" id="key" class="form-control">
                        <a href="#" class="doSearch"><i class="fa fa-search"></i></a>
                    </form>
                </li>

                <li class="dropdown hidden-xs">
                    <a data-toggle="dropdown" class="dropdown-toggle menu-item" href="#" aria-expanded="false">产品
                        <span class="caret"></span></a>
                    <ul role="menu" class="dropdown-menu">
                        <li><a href="{% url 'dashboard' %}">公共主页</a></li>
                        <li><a href="{% url 'products' %}">速卖通</a></li>
                        <li><a href="{% url 'products' %}">eBay</a></li>
                        <li><a href="{% url 'products' %}">Wish</a></li>

                    </ul>
                </li>
                <!--
                <li class="dropdown hidden-xs hidden-sm">
                    <a data-toggle="dropdown" class="dropdown-toggle menu-item" href="#" aria-expanded="false">物流
                        <span class="caret"></span></a>
                    <ul role="menu" class="dropdown-menu">
                        <li><a href="{% url 'logistics' %}">物流跟踪</a></li>
                        <li><a href="{% url 'logistics_list' %}">90天物流</a></li>
                        <li><a href="{% url 'logistics_import' %}">导入物流</a></li>
                        <li><a href="{% url 'logistics_settings' %}">调控设置</a></li>
                    </ul>
                </li>
                -->
                <li class="dropdown hidden-xs">
                    <a data-toggle="dropdown" class="dropdown-toggle menu-item" href="#" aria-expanded="false">店铺
                        <span class="caret"></span></a>
                    <ul role="menu" class="dropdown-menu">
                        <li><a href="{% url 'myStore' %}">我的店铺 <sup>beta</sup></a></li>
                        <li><a href="{% url 'monitorStore' %}">竞争店铺 <sup>beta</sup></a></li>
                        <li><a href="{% url 'monitorStoreNew' %}">新品跟踪 <sup>beta</sup></a></li>
                        <li><a href="{% url 'monitorStoreHot' %}">热销产品 <sup>beta</sup></a></li>

                    </ul>
                </li>
                <li class="dropdown hidden-xs">
                    <a data-toggle="dropdown" class="dropdown-toggle menu-item" href="#" aria-expanded="false">我的
                        <span class="caret"></span></a>
                    <ul role="menu" class="dropdown-menu">
                        <li><a href="{% url 'favorite' %}">产品收藏夹</a></li>
                        <li><a href="{% url 'monitor_products' %}">监控产品 <sup>beta</sup></a></li>
                        <li><a href="{% url 'myProducts' %}">产品跟踪</a></li>
                        <li><a href="{% url 'analysis' %}">数据分析 <sup>beta</sup></a></li>

                    </ul>
                </li>
                <li class="hidden-xs hidden-sm">
                    <button class="btn btn-success btn-rounded m-t-15" data-toggle="modal" data-target="#tabs-modal">增加采集任务</button>
                </li>
            </ul>

            <!-- Right(Notification) -->
            <ul class="nav navbar-nav navbar-right">
                <li>
                    <a href="#" class="right-menu-item dropdown-toggle" data-toggle="dropdown">
                        <i class="mdi mdi-bell"></i>
                        <span class="badge up bg-success" id="notice-count">{{ unread_num }}</span>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-right arrow-dropdown-menu arrow-menu-right dropdown-lg user-list notify-list">
                        <li>
                            <h5>通知</h5>
                        </li>

                                    {% if unread_notice %}
                                        {% for n in unread_notice %}
                                            <li>
                                    <a href="#" class="noticeDetail user-list-item" note-id="{{ n.id }}" data-toggle="modal" data-target="#readNoticeModal">
                                        <div class="icon bg-danger"><i class="mdi mdi-comment"></i></div>
                                        <div class="user-desc">
                                            <span class="name">{{ n.title }}</span>
                                            <span class="time">{{ n.send_time }}</span>
                                        </div>
                                    </a>
                                </li>
                                        {% endfor %}

                                    {% endif %}
                        <li class="all-msgs text-center">
                            <p class="m-0"><a href="#">查看全部通知</a></p>
                        </li>
                    </ul>
                </li>

                <li>
                    <a href="#" class="right-menu-item dropdown-toggle" data-toggle="dropdown">
                        <i class="mdi mdi-email"></i>
                        <span class="badge up bg-danger" id="mail-count">{{ unread_mail }}</span>
                    </a>

                    <ul class="dropdown-menu dropdown-menu-right arrow-dropdown-menu arrow-menu-right dropdown-lg user-list notify-list">
                        <li>
                            <h5>消息</h5>
                        </li>

                            {% if unread_messages %}
                                    {% for m in unread_messages %}
                                        <li>
                                    <a href="{% url 'readMail' m.id %}" class="user-list-item">
                                        <div class="avatar">
                                            <img src="{% static '' %}zircos/assets/images/users/avatar-2.jpg" alt="">
                                        </div>
                                        <div class="user-desc">
                                            <span class="name">Admin</span>
                                            <span class="desc">{{ m.title }}</span>
                                            <span class="time">{{ m.send_time }}</span>
                                        </div>

                                    </a>
                                </li>
                                    {% endfor %}
                                {% endif %}
                        <li class="all-msgs text-center">
                            <p class="m-0"><a href="{% url 'mailBox' %}">查看全部消息</a></p>
                        </li>
                    </ul>
                </li>

                <li class="hidden-xs hidden-sm">
                    <a href="javascript:void(0);" class="right-bar-toggle right-menu-item">
                        <i class="mdi mdi-settings"></i>
                    </a>
                </li>

                <li class="dropdown user-box">
                    <a href="" class="dropdown-toggle waves-effect user-link" data-toggle="dropdown" aria-expanded="true">
                        {% if user_profile.avatar %}
                        <img src="/uploads/{{ user_profile.avatar }}" alt="user-img" class="img-circle user-img">
                        {% else %}
                        <img src="{% static '' %}zircos/assets/images/users/avatar-1.jpg" alt="user-img" class="img-circle user-img">
                        {% endif %}
                    {% if user_profile.name %}{{ user_profile.name }}{% else %}{{ request.user.username }}{% endif %}
                    <span class="caret"></span>
                    </a>

                    <ul class="dropdown-menu dropdown-menu-right arrow-dropdown-menu arrow-menu-right user-list notify-list">


                        <li><a href="{% url 'profile' %}#aboutme"><i class="ti-user m-r-5"></i> 个人资料</a></li>
                        <li><a href="{% url 'changePassword' %}"><i class="ti-settings m-r-5"></i> 修改密码</a></li>
                        <li><a href="{% url 'profile' %}#projects"><i class="ti-lock m-r-5"></i> 任务管理</a></li>
                        <li><a href="{% url 'signout' %}"><i class="ti-power-off m-r-5"></i> 退出</a></li>
                    </ul>
                </li>

            </ul> <!-- end navbar-right -->

        </div><!-- end container -->
    </div><!-- end navbar -->
</div>